package com.t.bricks.bussiness.db.mapper.department;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.t.bricks.bussiness.db.entity.department.Department;
import com.t.bricks.bussiness.db.entity.department.base.DepartmentBase;

@Mapper
public interface DepartmentMapper {
	
	/**
	 * 添加
	 * @Param department
	 * @return
	 */
	int add(Department department);

	/**
	 * 删除
	 * @Param sId
	 * @Param iVersion
	 * @return
	 */
	int del(@Param("sId") String sId, @Param("iVersion") Integer iVersion);

	/**
	 * 修改
	 * 注意:当对象的属性值为null时不更新字段
	 * @Param departmentBase
	 * @return
	 */
	int edit(DepartmentBase departmentBase);

	/**
	 * 检查待修改内容是否存在重复数据
	 * @Param departmentBaseData
	 * @return 重复返回true
	 */
	int checkRepeatByEdit(DepartmentBase departmentBase);

	/**
	 * 检查待新增内容是否存在重复数据
	 * @Param departmentData
	 * @return 重复返回true
	 */
	int checkRepeatByAdd(Department departmentBase);
	
}
